home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / encryp / encrypt.frm < prev    next >
Text File  |  1995-05-02  |  4KB  |  118 lines

  1. VERSION 2.00
  2. Begin Form Formcrypt 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Encrypt/Decrypt Example"
  5.    ClientHeight    =   1905
  6.    ClientLeft      =   1725
  7.    ClientTop       =   3375
  8.    ClientWidth     =   5220
  9.    Height          =   2310
  10.    Left            =   1665
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1905
  13.    ScaleWidth      =   5220
  14.    Top             =   3030
  15.    Width           =   5340
  16.    Begin TextBox TextKey 
  17.       BackColor       =   &H00C0C0C0&
  18.       Height          =   285
  19.       Left            =   1440
  20.       TabIndex        =   9
  21.       Text            =   "SECRET STRING"
  22.       Top             =   60
  23.       Width           =   3675
  24.    End
  25.    Begin CommandButton CommandQuit 
  26.       Cancel          =   -1  'True
  27.       Caption         =   "&Quit"
  28.       Height          =   350
  29.       Left            =   4140
  30.       TabIndex        =   7
  31.       Top             =   1500
  32.       Width           =   1000
  33.    End
  34.    Begin CommandButton CommandExecute 
  35.       Caption         =   "&Execute"
  36.       Default         =   -1  'True
  37.       Height          =   350
  38.       Left            =   3060
  39.       TabIndex        =   6
  40.       Top             =   1500
  41.       Width           =   1000
  42.    End
  43.    Begin TextBox TextInput 
  44.       BackColor       =   &H00C0C0C0&
  45.       Height          =   285
  46.       Left            =   1440
  47.       TabIndex        =   1
  48.       Text            =   "Encyrpt This"
  49.       Top             =   435
  50.       Width           =   3675
  51.    End
  52.    Begin Label LabelKey 
  53.       BackStyle       =   0  'Transparent
  54.       Caption         =   "Encrypt &Key"
  55.       Height          =   255
  56.       Left            =   60
  57.       TabIndex        =   8
  58.       Top             =   90
  59.       Width           =   1095
  60.    End
  61.    Begin Label Label2 
  62.       BackStyle       =   0  'Transparent
  63.       Caption         =   "Decrypted"
  64.       Height          =   255
  65.       Left            =   60
  66.       TabIndex        =   4
  67.       Top             =   1125
  68.       Width           =   1095
  69.    End
  70.    Begin Label Label1 
  71.       BackStyle       =   0  'Transparent
  72.       Caption         =   "Encrypted"
  73.       Height          =   255
  74.       Left            =   60
  75.       TabIndex        =   2
  76.       Top             =   780
  77.       Width           =   1095
  78.    End
  79.    Begin Label LabelDecrypt 
  80.       BackColor       =   &H00C0C0C0&
  81.       BorderStyle     =   1  'Fixed Single
  82.       Height          =   255
  83.       Left            =   1440
  84.       TabIndex        =   5
  85.       Top             =   1155
  86.       Width           =   3675
  87.    End
  88.    Begin Label LabelEncrypt 
  89.       BackColor       =   &H00C0C0C0&
  90.       BorderStyle     =   1  'Fixed Single
  91.       Height          =   255
  92.       Left            =   1440
  93.       TabIndex        =   3
  94.       Top             =   810
  95.       Width           =   3675
  96.    End
  97.    Begin Label LabelText 
  98.       BackStyle       =   0  'Transparent
  99.       Caption         =   "&String"
  100.       Height          =   255
  101.       Left            =   60
  102.       TabIndex        =   0
  103.       Top             =   435
  104.       Width           =   1095
  105.    End
  106. End
  107. Option Explicit
  108.  
  109. Sub CommandExecute_Click ()
  110.   FormCrypt.LabelEncrypt.Caption = crypt("E", RTrim$(FormCrypt.TextKey.Text), RTrim$(FormCrypt.TextInput.Text))
  111.   FormCrypt.LabelDecrypt.Caption = crypt("D", RTrim$(FormCrypt.TextKey.Text), RTrim$(FormCrypt.LabelEncrypt.Caption))
  112. End Sub
  113.  
  114. Sub CommandQuit_Click ()
  115.   Unload FormCrypt
  116. End Sub
  117.  
  118.